/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.DAO;

import java.util.List;

import com.Entity.Feedback;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author KIS
 */
@Stateless
public class FeedbackFacade extends AbstractFacade<Feedback> {
    @PersistenceContext(unitName = "ManTechHelpdesk-EjbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public FeedbackFacade() {
        super(Feedback.class);
    }
    
    @SuppressWarnings("unchecked")
	public List<Feedback> getFeedbackListByStatus(int status){
    	Query query = getEntityManager().createNamedQuery("Feedback.findByStatus");
    	query.setParameter("status", status);
    	return (List<Feedback>)query.getResultList();
    }
    
}
